#pragma once
#include "RedBlackTree.h"


namespace wxd
{
	template <class K>
	class set
	{
	public:
		struct SetKeyOfT
		{
			K operator()(const K& key = key)
			{
				return key;
			}
		};
		typedef typename RBTree<K, const K, SetKeyOfT>::Iterator iterator;
		typedef typename RBTree<K, const K, SetKeyOfT>::ConstIterator const_iterator;

		iterator begin()
		{
			return _rbt.Begin();
		}
		iterator end()
		{
			return _rbt.End();
		}
		const_iterator begin()const
		{
			return _rbt.Begin();
		}
		const_iterator end()const
		{
			return _rbt.End();
		}

	
		bool Insert(const K& key)
		{
			return _rbt.Insert(key);
		}

	private:

		RBTree<K, const K, SetKeyOfT> _rbt;
		K _key = 0;
	};
	
}
